//
//  YHCheckBoxView.h
//  ScriptKill
//
//  Created by 林宁宁 on 2021/4/9.
//  Copyright © 2021 优智汇. All rights reserved.
//

#import "YHBaseView.h"
#import "YHBaseObject.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, YHCheckBoxSelectType) {
    ///单选
    YHCheckBoxSelectSingle,
    ///多个
    YHCheckBoxSelectMultiple,
    ///多个至少一个
    YHCheckBoxSelectMultipleAtLeastOne,
};

@class YHCheckBoxItem;
@class YHCheckBoxLayoutConfig;

/// 单选 复选框
@interface YHCheckBoxView : YHBaseView

@property (nonatomic, assign) YHCheckBoxSelectType checkType;

@property (retain, nonatomic) YHCheckBoxLayoutConfig * config;

/// 点击选择之后的回调
@property (copy, nonatomic) void(^clickBlock)(NSArray <YHCheckBoxItem *>* selectIndexs, YHCheckBoxView * checkBox);
@property (copy, nonatomic) void(^clickCurrentBlock)(YHCheckBoxItem * passCheck, NSInteger index, YHCheckBoxView * checkBox);

- (NSArray <YHCheckBoxItem *>*)currentSelectItems;

- (void)cleanAllCheckItems;

- (void)addCheckTitles:(NSArray <NSString *>*)titles;

- (void)addCheckItemTitle:(NSString *)title
                       ID:(NSString * _Nullable)ID;
- (void)addCheckItemTitle:(NSString *)title
                    type:(NSInteger)type;

- (void)addCheckItemTitle:(NSString *)title
                       ID:(NSString * _Nullable)ID
                     type:(NSInteger)type
                 isSelect:(BOOL)isSelect;

/// 选中该标题
- (void)selectCheckTitle:(NSString *)title;

/// 选中该类型
- (void)selectCheckType:(NSInteger)type;

@end



@interface YHCheckBoxItem : YHBaseObject

@property (copy, nonatomic) NSString * title;
@property (copy, nonatomic) NSString * ID;
@property (assign, nonatomic) NSInteger type;

@end

@interface YHCheckBoxLayoutConfig : YHBaseObject

@property (copy, nonatomic) NSString * imageNormal;
@property (copy, nonatomic) NSString * imageSelect;

/// 默认25
@property (assign, nonatomic) NSInteger space;

/// 布局方式居中
@property (assign, nonatomic) BOOL isLayoutCenter;

/// 滚动方向 默认 UICollectionViewScrollDirectionHorizontal
@property (assign, nonatomic) UICollectionViewScrollDirection scrollDirection;

@end


NS_ASSUME_NONNULL_END
